﻿<script type="text/javascript">
    BCL.singlePlayerTemplate = "<div style=\"display:none\"></div><object id=\"myExperience\" class=\"BrightcoveExperience\"><param name=\"bgcolor\" value=\"#64AAB2\" /><param name=\"width\" value=\"{{width}}\" /><param name=\"height\" value=\"{{height}}\" /><param name=\"playerID\" value=\"{{playerID}}\" /><param name=\"playerKey\" value=\"{{playerKey}}\" /><param name=\"isVid\" value=\"true\" /><param name=\"isUI\" value=\"true\" /><param name=\"dynamicStreaming\" value=\"true\" /><param name=\"@videoPlayer\" value=\"{{videoID}}\"; /><param name=\"wmode\" value=\"transparent\" /><param name=\"includeAPI\" value=\"true\" /><param name=\"templateLoadHandler\" value=\"BCL.onTemplateLoaded\" /><param name=\"templateReadyHandler\" value=\"BCL.onTemplateReady\" /></object>";
    BCL.addPlayer = function (playerTemplate, playerData) {
        var playerHTML = "";
        playerHTML = BCL.markup(playerTemplate, playerData);
        document.getElementById("VideoContainer").innerHTML = playerHTML;
        brightcove.createExperiences();
    };

    BCL.markup = function (html, data) {
        var m;
        var i = 0;
        var match = html.match(data instanceof Array ? /{{\d+}}/g : /{{\w+}}/g) || [];

        while (m = match[i++]) {
            html = html.replace(m, data[m.substr(2, m.length - 4)]);
        }
        return html;
    };
</script>